[,mediation_data,ANY,ANY,ANY-method: Subset a mediation dataset
Description
We can subset samples by indexing into a mediation dataset. It will subsample
all fields -- pretreatments, treatments, mediators, and outcomes. Note that
there is no way to subset columns in this way, since they would be different
across each source.
Usage
# S4 method for mediation_data,ANY,ANY,ANY
[(x, i, j, ..., drop = TRUE)
Value
A version of the input mediation_data object whose @mediators,
@outcomes, @treatments, and @pretreatments rows have all been subsetted
according to i.
Arguments
x
An object of class mediation_data whose samples we want to subset.
i
An integer or integer/logical vector specifying the samples to
subset to.
j
A placeholder to argree with R's [ function. Never used.
...
A placeholder to agree with R's [ function. Never used.
drop
A placeholder to agree with R's [ function. Never used.